import 'package:json_annotation/json_annotation.dart';

import 'axis_pointer.dart';
import 'item_style.dart';
import 'line_style.dart';

part 'timeline.g.dart';

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class TimelineLabel {
  var position;
  var show;
  var interval;
  var rotate;
  var formatter;

  var color;
  var fontStyle;
  var fontWeight;
  var fontFamily;
  var fontSize;
  var align;
  var verticalAlign;
  var lineHeight;

  var backgroundColor;
  var borderColor;
  var borderWidth;
  var borderType;
  var borderDashOffset;

  var borderRadius;
  var padding;
  var shadowColor;
  var shadowOffsetX;
  var shadowOffsetY;
  var width;
  var height;

  var textBorderColor;
  var textBorderWidth;
  var textBorderType;
  var textBorderDashOffset;

  var textShadowColor;
  var textShadowBlur;
  var textShadowOffsetX;
  var textShadowOffsetY;
  var overFlow;
  var ellipsis;
  var lineOverflow;
  var rich;

  TimelineLabel(
      {this.position,
      this.show,
      this.interval,
      this.rotate,
      this.formatter,
      this.color,
      this.fontStyle,
      this.fontWeight,
      this.fontFamily,
      this.fontSize,
      this.align,
      this.verticalAlign,
      this.lineHeight,
      this.backgroundColor,
      this.borderColor,
      this.borderWidth,
      this.borderType,
      this.borderDashOffset,
      this.borderRadius,
      this.padding,
      this.shadowColor,
      this.shadowOffsetX,
      this.shadowOffsetY,
      this.width,
      this.height,
      this.textBorderColor,
      this.textBorderWidth,
      this.textBorderType,
      this.textBorderDashOffset,
      this.textShadowColor,
      this.textShadowBlur,
      this.textShadowOffsetX,
      this.textShadowOffsetY,
      this.overFlow,
      this.ellipsis,
      this.lineOverflow,
      this.rich});


  factory TimelineLabel.fromJson(Map<String, dynamic> json) => _$TimelineLabelFromJson(json);

  Map<String, dynamic> toJson() => _$TimelineLabelToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class CheckPointStyle {
  var symbol;
  var symbolSize;
  var symbolRotate;
  var symbolKeepAspect;
  var symbolOffset;
  var color;
  var borderColor;
  var borderWidth;
  var borderType;
  var shadowBlur;
  var shadowColor;
  var shadowOffsetX;
  var shadowOffsetY;
  var opacity;
  var animation;
  var animationDuration;
  var animationEasing;

  CheckPointStyle(
      {this.symbol,
      this.symbolSize,
      this.symbolRotate,
      this.symbolKeepAspect,
      this.symbolOffset,
      this.color,
      this.borderColor,
      this.borderWidth,
      this.borderType,
      this.shadowBlur,
      this.shadowColor,
      this.shadowOffsetX,
      this.shadowOffsetY,
      this.opacity,
      this.animation,
      this.animationDuration,
      this.animationEasing});


  factory CheckPointStyle.fromJson(Map<String, dynamic> json) => _$CheckPointStyleFromJson(json);

  Map<String, dynamic> toJson() => _$CheckPointStyleToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class ControlStyle {
  var show;
  var showPlayBtn;
  var showPrevBtn;
  var showNextBtn;
  var itemSize;
  var itemGap;
  var position;
  var playIcon;
  var stopIcon;
  var prevIcon;
  var nextIcon;
  var color;
  var borderColor;
  var borderWidth;
  var borderType;
  var shadowBlur;
  var shadowColor;
  var shadowOffsetX;
  var shadowOffsetY;
  var opacity;

  ControlStyle(
      {this.show,
      this.showPlayBtn,
      this.showPrevBtn,
      this.showNextBtn,
      this.itemSize,
      this.itemGap,
      this.position,
      this.playIcon,
      this.stopIcon,
      this.prevIcon,
      this.nextIcon,
      this.color,
      this.borderColor,
      this.borderWidth,
      this.borderType,
      this.shadowBlur,
      this.shadowColor,
      this.shadowOffsetX,
      this.shadowOffsetY,
      this.opacity});

  factory ControlStyle.fromJson(Map<String, dynamic> json) => _$ControlStyleFromJson(json);

  Map<String, dynamic> toJson() => _$ControlStyleToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class TimelineEmphasis {
  TimelineLabel? label;
  ItemStyle? itemStyle;
  CheckPointStyle? checkPointStyle;
  ControlStyle? controlStyle;

  TimelineEmphasis(
      {this.label, this.itemStyle, this.checkPointStyle, this.controlStyle});


  factory TimelineEmphasis.fromJson(Map<String, dynamic> json) => _$TimelineEmphasisFromJson(json);

  Map<String, dynamic> toJson() => _$TimelineEmphasisToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class TimeLineProgress {
  LineStyle? lineStyle;
  ItemStyle? itemStyle;
  AxisPointLabel? label;

  TimeLineProgress({this.lineStyle, this.itemStyle, this.label});


  factory TimeLineProgress.fromJson(Map<String, dynamic> json) => _$TimeLineProgressFromJson(json);

  Map<String, dynamic> toJson() => _$TimeLineProgressToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class Timeline {
  var show;
  var type;
  var currentIndex;
  var autoPlay;
  var rewind;
  var loop;

  var playInterval;

  var realtime;

  var replaceMerge;

  var controlPosition;

  var zlvel;
  var z;
  var left;
  var top;
  var right;
  var bottom;

  var padding;

  var orient;
  var inverse;

  var symbol;
  var symbolSize;
  var symbolRotate;
  var symbolKeepAspect;
  var symbolOffset;

  LineStyle? lineStyle;
  TimelineLabel? label;
  ItemStyle? itemStyle;
  CheckPointStyle? checkPointStyle;
  ControlStyle? controlStyle;
  TimeLineProgress? progress;
  TimelineEmphasis? emphasis;
  var data;

  Timeline(
      {this.show,
      this.type,
      this.currentIndex,
      this.autoPlay,
      this.rewind,
      this.loop,
      this.playInterval,
      this.realtime,
      this.replaceMerge,
      this.controlPosition,
      this.zlvel,
      this.z,
      this.left,
      this.top,
      this.right,
      this.bottom,
      this.padding,
      this.orient,
      this.inverse,
      this.symbol,
      this.symbolSize,
      this.symbolRotate,
      this.symbolKeepAspect,
      this.symbolOffset,
      this.lineStyle,
      this.label,
      this.itemStyle,
      this.checkPointStyle,
      this.controlStyle,
      this.progress,
      this.emphasis,
      this.data});


  factory Timeline.fromJson(Map<String, dynamic> json) => _$TimelineFromJson(json);

  Map<String, dynamic> toJson() => _$TimelineToJson(this);
}
